;就地反转abc...z 26个字母，同时写入显存

jmp start

string db 'abcdefghijklmnopgrstuvwxyz'

start:
mov ax,0xb800
mov es,ax
mov ax,0x7c0
mov ds,ax
mov ax,0
mov ss,ax
mov sp,ax

mov cx,start-string;循环次数
mov si,string

;压栈
pushLoop:
mov  al,byte [si]
push ax 
inc si
loop pushLoop

mov cx,start-string
mov si,string

;出栈
popLoop:
pop ax
mov byte [si],al
inc si
loop popLoop

;将反转结果写入显存
mov cx,start-string
mov si,string
mov di,0

showLoop:
mov al,[si];基址寻址，将内存的字符放到al
mov ah,7;高位放属性
mov word [es:di],ax
inc si 
add di,2
loop showLoop


jmp $

times 510-($-$$) db 0
db 0x55,0xaa